<?php
namespace App\Admin\Renderable\Shop;

use App\Models\Shop\WxShopContact;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;

class ShopContactRender extends LazyRenderable
{
    public function grid(): Grid
    {
        return Grid::make(new WxShopContact(), function (Grid $grid) {
            $grid->column('id')->sortable();
            $grid->column('user_id');
            $grid->column('shop_id');
            $grid->column('name');
            $grid->column('country_code');
            $grid->column('phone');
            $grid->column('longitude');
            $grid->column('latitude');
            $grid->column('address_name');
            $grid->column('address_detail');
            $grid->column('created_at');
            $grid->column('updated_at')->sortable();

            $grid->filter(function (Grid\Filter $filter) {
                $filter->equal('id');
            });
        });
    }
}
